import { wechatrequest } from './API/request'
import { getGlobalData } from '../configuration/globaldata'

const url = getGlobalData('API_IM')

/**
 * 保存formId
 */
export const saveFormIdRequest = ({ formId, openId, userId }) => {
  return wechatrequest.postform(`${url}/proxy/saveFormId`, {
    data: { formId, openId, userId }
  })
}
/**
 * 解析companyID 记录推广
 */
export const insertRecommendHistory = ({ companyId, openId }) => {
  return wechatrequest.postform(`${url}/user/insertRecommendHistory`, {
    data: { companyId, openId }
  })
}
/**
 * 发送推送
 */
export const sendMessageRequest = ({ templateType, sendModel, userId }) => {
  return wechatrequest.postbody(
    `${url}/proxy/send?templateType=${templateType}&userId=${userId}`,
    {
      data: sendModel
    }
  )
}
